home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / do-eve1r / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-07-11  |  9.8 KB  |  298 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  4. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  5. Begin VB.Form Form1 
  6.    BackColor       =   &H00000000&
  7.    BorderStyle     =   1  'Fixed Single
  8.    Caption         =   "Lightning"
  9.    ClientHeight    =   3090
  10.    ClientLeft      =   150
  11.    ClientTop       =   450
  12.    ClientWidth     =   9225
  13.    Icon            =   "frmmain.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   3090
  17.    ScaleWidth      =   9225
  18.    StartUpPosition =   3  'Windows Default
  19.    Begin ComctlLib.StatusBar StatusBar1 
  20.       Align           =   2  'Align Bottom
  21.       Height          =   270
  22.       Left            =   0
  23.       TabIndex        =   16
  24.       Top             =   2820
  25.       Width           =   9225
  26.       _ExtentX        =   16272
  27.       _ExtentY        =   476
  28.       SimpleText      =   ""
  29.       _Version        =   327682
  30.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  31.          NumPanels       =   3
  32.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  33.             Text            =   "Your IP:"
  34.             TextSave        =   "Your IP:"
  35.             Object.Tag             =   ""
  36.          EndProperty
  37.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  38.             Style           =   5
  39.             TextSave        =   "4:47 PM"
  40.             Object.Tag             =   ""
  41.          EndProperty
  42.          BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  43.             Style           =   6
  44.             TextSave        =   "7/11/99"
  45.             Object.Tag             =   ""
  46.          EndProperty
  47.       EndProperty
  48.    End
  49.    Begin VB.Frame Frame4 
  50.       BackColor       =   &H00800000&
  51.       Caption         =   "Connection Info"
  52.       ForeColor       =   &H0000FFFF&
  53.       Height          =   2655
  54.       Left            =   5760
  55.       TabIndex        =   9
  56.       Top             =   120
  57.       Width           =   3375
  58.       Begin RichTextLib.RichTextBox rt 
  59.          Height          =   2295
  60.          Left            =   120
  61.          TabIndex        =   10
  62.          Top             =   240
  63.          Width           =   3135
  64.          _ExtentX        =   5530
  65.          _ExtentY        =   4048
  66.          _Version        =   327680
  67.          BackColor       =   8421504
  68.          Enabled         =   -1  'True
  69.          ScrollBars      =   2
  70.          TextRTF         =   $"frmmain.frx":08CA
  71.       End
  72.    End
  73.    Begin VB.Frame Frame3 
  74.       BackColor       =   &H00800000&
  75.       Caption         =   "Functions"
  76.       ForeColor       =   &H0000FFFF&
  77.       Height          =   1215
  78.       Left            =   120
  79.       TabIndex        =   8
  80.       Top             =   1560
  81.       Width           =   2895
  82.       Begin VB.CommandButton Command5 
  83.          Caption         =   "&About"
  84.          Height          =   375
  85.          Left            =   2040
  86.          TabIndex        =   13
  87.          Top             =   720
  88.          Width           =   735
  89.       End
  90.       Begin VB.CommandButton Command4 
  91.          Caption         =   "&Use"
  92.          Height          =   375
  93.          Left            =   2040
  94.          TabIndex        =   12
  95.          Top             =   240
  96.          Width           =   735
  97.       End
  98.       Begin VB.ListBox List3 
  99.          BackColor       =   &H00808080&
  100.          Height          =   840
  101.          Left            =   120
  102.          TabIndex        =   11
  103.          Top             =   240
  104.          Width           =   1815
  105.       End
  106.    End
  107.    Begin VB.Frame Frame2 
  108.       BackColor       =   &H00800000&
  109.       Caption         =   "Fun Stuff"
  110.       ForeColor       =   &H0000FFFF&
  111.       Height          =   2655
  112.       Left            =   3120
  113.       TabIndex        =   5
  114.       Top             =   120
  115.       Width           =   2535
  116.       Begin VB.CommandButton Command6 
  117.          Caption         =   "&About"
  118.          Height          =   375
  119.          Left            =   960
  120.          TabIndex        =   14
  121.          Top             =   2160
  122.          Width           =   735
  123.       End
  124.       Begin VB.CommandButton Command3 
  125.          Caption         =   "&Use"
  126.          Height          =   375
  127.          Left            =   120
  128.          TabIndex        =   7
  129.          Top             =   2160
  130.          Width           =   735
  131.       End
  132.       Begin VB.ListBox List2 
  133.          BackColor       =   &H00808080&
  134.          Height          =   1815
  135.          Left            =   120
  136.          TabIndex        =   6
  137.          Top             =   240
  138.          Width           =   2295
  139.       End
  140.    End
  141.    Begin VB.Frame Frame1 
  142.       BackColor       =   &H00800000&
  143.       Caption         =   "IP of computer to control"
  144.       ForeColor       =   &H0000FFFF&
  145.       Height          =   1335
  146.       Left            =   120
  147.       TabIndex        =   0
  148.       Top             =   120
  149.       Width           =   2895
  150.       Begin VB.CommandButton Command7 
  151.          Caption         =   "&Save"
  152.          Height          =   255
  153.          Left            =   1920
  154.          TabIndex        =   15
  155.          Top             =   960
  156.          Width           =   855
  157.       End
  158.       Begin VB.CommandButton Command2 
  159.          Caption         =   "&Connect"
  160.          Height          =   255
  161.          Left            =   1920
  162.          TabIndex        =   4
  163.          Top             =   600
  164.          Width           =   855
  165.       End
  166.       Begin VB.ListBox List1 
  167.          BackColor       =   &H00808080&
  168.          Height          =   645
  169.          Left            =   120
  170.          TabIndex        =   3
  171.          Top             =   600
  172.          Width           =   1695
  173.       End
  174.       Begin VB.CommandButton Command1 
  175.          Caption         =   "&Add"
  176.          Height          =   255
  177.          Left            =   1920
  178.          TabIndex        =   2
  179.          Top             =   240
  180.          Width           =   855
  181.       End
  182.       Begin VB.TextBox Text1 
  183.          BackColor       =   &H00808080&
  184.          Height          =   285
  185.          Left            =   120
  186.          TabIndex        =   1
  187.          Top             =   240
  188.          Width           =   1695
  189.       End
  190.    End
  191.    Begin MSWinsockLib.Winsock Win 
  192.       Left            =   2880
  193.       Top             =   0
  194.       _ExtentX        =   741
  195.       _ExtentY        =   741
  196.    End
  197.    Begin MSWinsockLib.Winsock Winsock2 
  198.       Left            =   5520
  199.       Top             =   0
  200.       _ExtentX        =   741
  201.       _ExtentY        =   741
  202.    End
  203. Attribute VB_Name = "Form1"
  204. Attribute VB_GlobalNameSpace = False
  205. Attribute VB_Creatable = False
  206. Attribute VB_PredeclaredId = True
  207. Attribute VB_Exposed = False
  208. Private Sub Command1_Click()
  209. List1.AddItem Text1.Text
  210. Text1.Text = ""
  211. End Sub
  212. Private Sub Command2_Click()
  213. On Error GoTo er
  214. Win.RemoteHost = List1.Text
  215. Win.SendData "Connect"
  216. ip = List1.Text
  217. Exit Sub
  218. MsgBox "An error has occurred.  Most likely you forgot to highlight an address", vbCritical, "Error"
  219. Exit Sub
  220. End Sub
  221. Private Sub Command3_Click()
  222. Dim command As String
  223. On Error GoTo er
  224.     command = List2.Text
  225.     With Win
  226.      .SendData command
  227.     End With
  228.     Exit Sub
  229. Exit Sub
  230. End Sub
  231. Private Sub Command4_Click()
  232. On Error GoTo er
  233. Select Case List3.Text
  234. Case "Open a website"
  235. mf = InputBox("Enter the url of the website you would like to open:", "Enter url")
  236. Win.SendData "Web " & mf
  237. Case "Open a program"
  238. mf = InputBox("Enter the location of the file you would like to open:", "Enter File Location")
  239. Win.SendData "Ope " & mf
  240. Case "Annoying loop"
  241. mf = InputBox("Enter the message you would like displayed:", "Enter the message")
  242. l = InputBox("Enter how many times you want the loop to repeat:", "Number of repeats")
  243. For X = 0 To l
  244. Win.SendData "Mes " & mf
  245. Next X
  246. Case "Send a message"
  247. Form2.Show
  248. End Select
  249. Exit Sub
  250. End Sub
  251. Private Sub Command5_Click()
  252. MsgBox "These commands do require some input from you." & Chr(10) & Chr(10) & "Any command in here, does require you to input some information.  Such as a url, or a filename, and other such things.", vbQuestion
  253. End Sub
  254. Private Sub Command6_Click()
  255. MsgBox "These commands don't require any input from you." & Chr(10) & Chr(10) & "Any commands in here simply require you to select them, and press ok.  The program won't require any inputed information.", vbQuestion
  256. End Sub
  257. Private Sub Command7_Click()
  258. SaveListBox List1, App.Path & "ip.lst"
  259. End Sub
  260. Private Sub Form_Load()
  261.  With Winsock2
  262.      .Protocol = sckUDPProtocol
  263.      .RemotePort = 693
  264.      .Bind
  265.     End With
  266.     With Win
  267.      .Protocol = sckUDPProtocol
  268.      .RemotePort = 692
  269.      .Bind
  270.     End With
  271.     List2.AddItem "Open Cdrom"
  272.     List2.AddItem "Close Cdrom"
  273.     List3.AddItem "Open a website"
  274.     List3.AddItem "Open a program"
  275.     List3.AddItem "Annoying loop"
  276.     List3.AddItem "Send a message"
  277.     StatusBar1.Panels(1).Text = StatusBar1.Panels(1).Text & " " & Win.LocalIP
  278. LoadListBox List1, App.Path & "\ip.lst"
  279. End Sub
  280. Private Sub Win_DataArrival(ByVal bytesTotal As Long)
  281. Dim data As String
  282. Win.GetData data
  283. rt.SelText = Win.RemoteHostIP & ": " & data & vbCrLf
  284. End Sub
  285. Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  286. Select Case Left(data, 3)
  287. Case "Meg"
  288. ms = Right(data, Len(data) - 4)
  289. Form3.Text1.Text = data
  290. If Form3.Visible = False Then
  291. Form3.Show
  292. Exit Sub
  293. End If
  294. End Select
  295. End Sub
  296. Private Sub Winsock2_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  297. End Sub
  298.